package org.yang.faq.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("test")
public class TestController {
    private Map<String,Object> map= Collections.synchronizedMap(new HashMap<String, Object>());
    @RequestMapping(value = "getUser",method = RequestMethod.GET )
    public Object getUser(){
        return new HashMap<String,String>().put("1","1");
    }
    @RequestMapping(value = "deleteUser",method = RequestMethod.DELETE)
    public Object deleteUser(){
        return new Object();
    }
    @RequestMapping(value = "putUser/{id}",method = RequestMethod.PUT)
    public Object putUser(@PathVariable("id") String id){
        map.put(id,id);
        return map;
    }
}
